package com.campus.controller;

import com.campus.pojo.entity.Lab;
import com.campus.result.Result;
import com.campus.service.LabService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/lab")
@Slf4j
public class LabController {
    
    @Autowired
    private LabService labService;
    
    /**
     * 查询所有实验室
     *
     * @return 所有实验室列表
     */
    @GetMapping("/getAllLab")
    public Result<List<Lab>> getALL() {
        log.info("查询所有实验室");
        List<Lab> labList = labService.getAll();
        return Result.success(labList);
    }
}
